home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Networking / OTTCPWillDial / Read Me About OTTCPWillDial < prev    next >
Encoding:
Text File  |  2000-09-28  |  3.9 KB  |  67 lines  |  [TEXT/ttxt]

  1. Read Me About OTTCPWillDial
  2.  
  3. 1.0b2
  4.  
  5. This sample shows how to use the Network Setup library (as introduced in Mac OS 8.5) to determine whether opening a TCP/IP provider will cause a modem to dial.  If the Network Setup library is not available, the sample will read the "TCP/IP Preferences" file directly.
  6.  
  7. Packing List
  8.  
  9. The sample contains the following items:
  10.  
  11. • TestOTTCPWillDial.µ — A project that builds a test program that demonstrates the use of OTTCPWillDial.
  12. • OTTCPWillDial — A compiled version of the above.
  13. • TestOTTCPWillDial.c — The source code to the test program.
  14. • OTTCPWillDial.h — A header that describes the (very basic) interface to OTTCPWillDial.
  15. • OTTCPWillDial.c — Source code to OTTCPWillDial.
  16. • Network Setup SDK Bits — Pre-release interfaces and libraries from the Network Setup SDK.
  17.  
  18. Using the Sample
  19.  
  20. To use the sample, simple run the OTTCPWillDial application.  It will tell you whether opening a TCP/IP provider will dial the modem.
  21.  
  22. Building the Sample
  23.  
  24. The sample was built using the CodeWarrior Pro 4 C compiler. 
  25.  
  26. To build the sample, the first thing you have to do is grab all the OT interface files from the OT SDK and put them in one folder. The interfaces that come with CodeWarrior don’t include all the low-level APIs that you will need.  Similarly, you should group all the OT libraries in the same folder. Then modify the access paths for the project to point those folders.
  27.  
  28. Then just open the project, select the “OTTCPWillDial” target, and choose Make from the Project menu.  This will build the OTTCPWillDial application.
  29.  
  30. How it Works
  31.  
  32. OTTCPWillDial contains two code paths.  If the Network Setup library is not available, the OTTCPWillDial will look read the information directly out of the "TCP/IP Prefereces" file in the Prefererences folder.  If Network Setup is installed, OTTCPWillDial will use it to read the information.
  33.  
  34. Before you look at the code, you need some idea of the Network Setup 'big picture'.  At the time of writing, there are four sources for information:
  35.  
  36. 1. The document "NetworkSetupBigPicture.html" (in the "Network Setup SDK Bits" folder) contains a one page summary of the Network Setup concepts.
  37.  
  38. 2. The Network Setup header files contain numerous comments describing the API.
  39.  
  40. 3. The "Open Tpt TCP/IP Dev. Note" (part of the OT SDK) contains a description of the original "TCP/IP Preferences" file format.  Many of the preferences in the Network Setup database are byte-for-byte compatible with their corresponding resources described in that document.
  41.  
  42. 4. The Network Setup Scripting scripting addition contains a dictionary that roughly reflects the contents of the Network Setup database.  You can learn a lot about how the database is structured by reading through the dictionary and sending experimental queries from AppleScript.
  43.  
  44. Caveats
  45.  
  46. The current implementation does not look to see whether the modem link is set to "Connect automatically when starting TCP/IP applications."  Doing so would require special case code for ARA 3.x versus OT/PPP versus FreePPP etc.  Instead, the code makes the simplifying assumption that any modem link layer (ie devices of type kOTMDEVDevice, kOTSLIPDevice, or kOTPPPDevice) is a potential dial.
  47.  
  48. The code is based on pre-release Network Setup interfaces and libraries.  It's likely that some file names and structure names will change before the final interfaces are released.
  49.  
  50. Credits and Version History
  51.  
  52. If you find any problems with this sample, mail <DTS@apple.com> with “Attn: Quinn” as the first line of your mail and I’ll try to fix them up.
  53.  
  54. 1.0d1 and 1.0d2 (Apr 1998) shipped to a number of Apple internal developers.
  55.  
  56. 1.0b1 (Sep 1998) was released for internal review.  It was works correctly with Mac OS 8.5 final.
  57.  
  58. 1.0b2 (Oct 1998) was the first shipping version.  It's was an update to use the latest Network Setup interfaces and libraries.
  59.  
  60. Share and Enjoy.
  61.  
  62. Quinn “The Eskimo!”
  63. Apple Developer Technical Support
  64. Networking, Communications, Hardware
  65.  
  66. 26 Oct 1998
  67.